package com.zc.im.mapper.im.group;

import com.zc.im.model.im.group.ZcImGroupSign;
import com.zc.im.model.im.group.ZcImGroupSignExample;
import com.zc.im.model.im.group.ZcImGroupSignKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ZcImGroupSignMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_sign
     *
     * @mbggenerated
     */
    int countByExample(ZcImGroupSignExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_sign
     *
     * @mbggenerated
     */
    int deleteByExample(ZcImGroupSignExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_sign
     *
     * @mbggenerated
     */
    @Delete({
        "delete from zc_im_group_sign",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(ZcImGroupSignKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_sign
     *
     * @mbggenerated
     */
    @Insert({
        "insert into zc_im_group_sign (id, group_id, ",
        "sign_addr_model, sign_type, ",
        "sign_mode, sign_pics, ",
        "sign_content, normal_sign_time, ",
        "normal_sign_status, user_id, ",
        "company_id, created_time, ",
        "updated_time, status)",
        "values (#{id,jdbcType=INTEGER}, #{groupId,jdbcType=INTEGER}, ",
        "#{signAddrModel,jdbcType=VARCHAR}, #{signType,jdbcType=VARCHAR}, ",
        "#{signMode,jdbcType=VARCHAR}, #{signPics,jdbcType=VARCHAR}, ",
        "#{signContent,jdbcType=VARCHAR}, #{normalSignTime,jdbcType=TIMESTAMP}, ",
        "#{normalSignStatus,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, ",
        "#{companyId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, ",
        "#{updatedTime,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=true, resultType=Integer.class)
    int insert(ZcImGroupSign record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_sign
     *
     * @mbggenerated
     */
    int insertSelective(ZcImGroupSign record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_sign
     *
     * @mbggenerated
     */
    List<ZcImGroupSign> selectByExample(ZcImGroupSignExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_sign
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "id, group_id, sign_addr_model, sign_type, sign_mode, sign_pics, sign_content, ",
        "normal_sign_time, normal_sign_status, user_id, company_id, created_time, updated_time, ",
        "status",
        "from zc_im_group_sign",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ZcImGroupSign selectByPrimaryKey(ZcImGroupSignKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_sign
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") ZcImGroupSign record, @Param("example") ZcImGroupSignExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_sign
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") ZcImGroupSign record, @Param("example") ZcImGroupSignExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_sign
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(ZcImGroupSign record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_sign
     *
     * @mbggenerated
     */
    @Update({
        "update zc_im_group_sign",
        "set group_id = #{groupId,jdbcType=INTEGER},",
          "sign_addr_model = #{signAddrModel,jdbcType=VARCHAR},",
          "sign_type = #{signType,jdbcType=VARCHAR},",
          "sign_mode = #{signMode,jdbcType=VARCHAR},",
          "sign_pics = #{signPics,jdbcType=VARCHAR},",
          "sign_content = #{signContent,jdbcType=VARCHAR},",
          "normal_sign_time = #{normalSignTime,jdbcType=TIMESTAMP},",
          "normal_sign_status = #{normalSignStatus,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=INTEGER},",
          "company_id = #{companyId,jdbcType=INTEGER},",
          "created_time = #{createdTime,jdbcType=TIMESTAMP},",
          "updated_time = #{updatedTime,jdbcType=TIMESTAMP},",
          "status = #{status,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ZcImGroupSign record);
}